package inc.unlocked.service.Impl;

import inc.unlocked.dao.PersonDAO;
import inc.unlocked.domain.Person;
import inc.unlocked.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * User: MTolstykh
 * Date: 29.06.12
 * Time: 19:23
 */
@Service
public class PersonServiceImpl implements PersonService{
    @Autowired
    private PersonDAO personDAO;


    public Person findById(Long id, Boolean initPhoto) {
        return personDAO.findById(id);
    }

    public List<Person> findAll(Boolean initPhoto) {
        return personDAO.findAll();
    }

    public void saveOrUpdate(Person person) {
        personDAO.saveOrUpdate(person);
    }

    public void delete(Person person) {
        personDAO.delete(person);
    }
}
